<?php

namespace App\Lib\RpcClient;

use App\Lib\Consul\AbstractService;

/**
 * 虚拟的 Rpc Client
 * Class AbstractClient
 * @package App\Lib\RpcClient
 */
abstract class AbstractClient extends AbstractService implements ClientInterface
{


    /**
     * 请求的服务类名
     * @var string
     */
    protected $class = '';

    /**
     * 请求的服务类方法
     * @var string
     */
    protected $action = '';

    /**
     * 默认参数为 空数组
     * @var array
     */
    protected $params = [];

    /**
     * 默认版本为 1.0
     * @var string
     */
    protected $version = '1.0';

    /**
     * @var array
     */
    protected $ext = [];

    /**
     * @return string
     */
    public function getClass(): string
    {
        return $this->class;
    }

    /**
     * @param string $class
     * @return AbstractClient
     */
    public function setClass(string $class): AbstractClient
    {
        $this->class = $class;
        return $this;
    }

    /**
     * @return string
     */
    public function getAction(): string
    {
        return $this->action;
    }

    /**
     * @param string $action
     * @return AbstractClient
     */
    public function setAction(string $action)
    {
        $this->action = $action;
        return $this;
    }

    /**
     * @return array
     */
    public function getParams(): array
    {
        return $this->params;
    }

    /**
     * @param array $params
     * @return AbstractClient
     */
    public function setParams(array $params)
    {
        $this->params = $params;
        return $this;
    }

    /**
     * @return string
     */
    public function getVersion(): string
    {
        return $this->version;
    }

    /**
     * @param string $version
     * @return AbstractClient
     */
    public function setVersion(string $version)
    {
        $this->version = $version;
        return $this;
    }

    /**
     * @return array
     */
    public function getExt(): array
    {
        return $this->ext;
    }

    /**
     * @param array $ext
     * @return AbstractClient
     */
    public function setExt(array $ext)
    {
        $this->ext = $ext;
        return $this;
    }

}
